package ie.dcu.spca.model.sql;

public class productSQL {
    public static String selectProductListByName = "SELECT * FROM product WHERE name='%s';";

    public static String selectProductListByBarcode = "SELECT * FROM product WHERE barcode='%s';";

    public static String selectProductByCategoryId = "SELECT * FROM product WHERE category_id=%d;";

    public static String insertProdect = "INSERT INTO product VALUES(?,?,?,?,?,?,?,?,?);";

    public static String selectById = "SELECT * FROM product WHERE id=%d";

    public static String insertByBean = "INSERT INTO product VALUES(?,?,?,?,?,?,?,?,?);";

    public static String deleteById = "UPDATE product SET delete_at=? WHERE id=?";

    public static String deleteByBean = "";

    public static String updateByBean = "UPDATE product SET name=?,price=?,barcode=?,unit_id=?,category_id=?,create_at=?,update_at=?,delete_at=? WHERE id=?;";

    public static String selectMaxId = "SELECT MAX(id) as max FROM product;";

    public static String existById = "SELECT * FROM product WHERE id=%d;";

    public static String isDeletedById = "SELECT * FROM product WHERE id=%d AND delete_at==0;";

    public static String selectAllBean = "SELECT * FROM product WHERE delete_at==0 ORDER BY update_at DESC, create_at DESC;";
}
